widget-factory: Add an Inspector menu item
authorMatthias Clasen <mclasen@redhat.com>
Tue, 16 Apr 2019 22:06:12 +0000 (18:06 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 16 Apr 2019 22:06:12 +0000 (18:06 -0400)
Just because we can.

demos/widget-factory/widget-factory.c
demos/widget-factory/widget-factory.ui

index 7a32c37610d90ff9335c20533b61df65c96b969c..c6969ea95ef79bfca6d0aa437c9f01bdafafee2c 100644 (file)
@@ -262,6 +262,14 @@ activate_quit (GSimpleAction *action,
     }
 }
 
+static void
+activate_inspector (GSimpleAction *action,
+                    GVariant      *parameter,
+                    gpointer       user_data)
+{
+  gtk_window_set_interactive_debugging (TRUE);
+}
+
 static void
 spin_value_changed (GtkAdjustment *adjustment, GtkWidget *label)
 {
@@ -1935,6 +1943,7 @@ main (int argc, char *argv[])
   static GActionEntry app_entries[] = {
     { "about", activate_about, NULL, NULL, NULL },
     { "quit", activate_quit, NULL, NULL, NULL },
+    { "inspector", activate_inspector, NULL, NULL, NULL },
     { "main", NULL, "s", "'steak'", NULL },
     { "wine", NULL, NULL, "false", NULL },
     { "beer", NULL, NULL, "false", NULL },
index aa61c3b0f7569117c4cf1172c71dc3ae144b8106..095cbdbc566d20ec655d76152565cd965f1cea2b 100644 (file)
       </item>
     </section>
     <section>
+      <item>
+        <attribute name="label" translatable="yes">_Inspector</attribute>
+        <attribute name="action">app.inspector</attribute>
+      </item>
       <item>
         <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
         <attribute name="action">win.show-help-overlay</attribute>